package com.mingqijia.gassafety.shared.utils;

import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;

import java.io.IOException;

/**
 * Description:
 *
 * @author StormyLiu
 * @since 2023/4/26
 */
public class OkHttpUtils {

    /**
     * 执行请求
     */
    public static Response doRequest(Request request) {
        Response response;
        try {
            OkHttpClient okHttpClient = new OkHttpClient.Builder().build();
            response = okHttpClient.newCall(request).execute();
        } catch (IOException e) {
            return null;
        }
        return response;
    }
}